var page = 1,limit=10;
var totalPage = 0;
var totalres=[];
window.addEventListener('onDropdown', function(event){
    console.log('下接刷新：' );

    if(page<totalPage){
        page++;

        loadData(this.page,this.limit);
    }else{
        // console.log(page)
         pop_up("最后一页")
    }
});
function loadData(ipage,ilimit) {
    server.req('wechat/membercashapply/list', {page: ipage, limit: ilimit}, function (res) {
        if(res.code==0){
            if(res.data.length>0){
                $("#getcashlist_nodata").css("display","none");
            }

            totalres = totalres.concat(res.data);
            if (totalres)
                res.data = totalres;

            totalPage = res.totalPage;
            if (res.code == 0) {
                console.log(res);
                res.data.forEach(function (item,index) {
                    if(item.status==1){
                        res.data[index].strStatus="待审核";
                    }else if(item.status==2){
                        res.data[index].strStatus="待付款";
                    }else if(item.status==3){
                        res.data[index].strStatus="已付款";
                    }else if(item.status==-1){
                        res.data[index].strStatus="已驳回";
                    }

                })
                server.loadData(".container",res);
            }
        }

    })
};
loadData(page,limit);